<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var sum = 0;
        var average = 0;
        for (let i = 0; i <= 100; i++) {
            sum += i;
        }
        average = sum / 100;
        console.log('1~100之间的平均值' + average);
        //第二个
        var ever = 0;
        var odd = 0;
        for (var i = 1; i <= 100; i++) {
            if (i % 2 == 0) {
                ever += i;
            } else {
                odd += i;
            }
        }
        console.log('1~100之间所有偶数的和：' + ever);
        console.log('1~100之间所有奇数的和：' + odd);

        //第三个  能被3整除的数字的和
        var result = 0;
        for (i = 1; i <= 100; i++) {
            if (i % 3 == 0) {
                result += i;
            }
        }
        console.log('1~100之间所有能被3整除的和：' + result);
        //1到100的和
        var sum = 0;
        for (i = 1; i <= 100; i++) {
            sum += i;
        }
        console.log('1~100之间的和为：' + sum);
    </script>
</head>

<body>

</body>

</html>